class CanshusController < ApplicationController
  # GET /canshus
  # GET /canshus.xml
  def index
    @canshus = Canshu.all

    respond_to do |format|
      format.html # index.html.erb
      format.xml  { render :xml => @canshus }
    end
  end

  # GET /canshus/1
  # GET /canshus/1.xml
  def show
    @canshu = Canshu.find(params[:id])

    respond_to do |format|
      format.html # show.html.erb
      format.xml  { render :xml => @canshu }
    end
  end

  # GET /canshus/new
  # GET /canshus/new.xml
  def new
    @canshu = Canshu.new

    respond_to do |format|
      format.html # new.html.erb
      format.xml  { render :xml => @canshu }
    end
  end

  # GET /canshus/1/edit
  def edit
    @canshu = Canshu.find(params[:id])
  end

  # POST /canshus
  # POST /canshus.xml
  def create
    @canshu = Canshu.new(params[:canshu])

    respond_to do |format|
      if @canshu.save
        flash[:notice] = 'Canshu was successfully created.'
        format.html { redirect_to(@canshu) }
        format.xml  { render :xml => @canshu, :status => :created, :location => @canshu }
      else
        format.html { render :action => "new" }
        format.xml  { render :xml => @canshu.errors, :status => :unprocessable_entity }
      end
    end
  end

  # PUT /canshus/1
  # PUT /canshus/1.xml
  def update
    @canshu = Canshu.find(params[:id])

    respond_to do |format|
      if @canshu.update_attributes(params[:canshu])
        flash[:notice] = 'Canshu was successfully updated.'
        format.html { redirect_to(@canshu) }
        format.xml  { head :ok }
      else
        format.html { render :action => "edit" }
        format.xml  { render :xml => @canshu.errors, :status => :unprocessable_entity }
      end
    end
  end

  # DELETE /canshus/1
  # DELETE /canshus/1.xml
  def destroy
    @canshu = Canshu.find(params[:id])
    @canshu.destroy

    respond_to do |format|
      format.html { redirect_to(canshus_url) }
      format.xml  { head :ok }
    end
  end
end
